<p><strong><?php echo __('Your pages :') ?></strong></p><br/><br/>

<div class="border" width="400px">
    <?php foreach($pages as $page): ?>
        <fieldset >
            <legend>
                <b><?php echo $page->Profile->name ?></b>
            </legend>
            <div style="float:left;">
                <fb:profile-pic uid="<?php echo $page->getPageId() ?>" linked="false" size="normal" width = "100"/>
            </div>
            <div align="center">
            <?php /* if authorized, show credentials */ if ($page->ApiCredentials->isAvailable()): ?>
                <?php echo __('Copy and paste the following fields :') ?> <br/>
                <table cellpadding="4px" style="background:#ddd;margin:5px;">
                <tr><td style="text-align:right;"><b>Page ID </b> </td><td>  <?php echo $page->ApiCredentials->page_id ?> </td></tr>
                  <tr><td style="text-align:right;"><b>API Secret</b> </td><td> <?php echo $page->ApiCredentials->api_secret ?><br/></td></tr>
                </table>
                <br/>
                <?php if ($page->PagePlan->Plan->name === 'trial'): /*Display a warning for trials*/ ?>
                     <span class="littleGrey"><?php echo __('This page has access to the API while it is on "Trial", API access will stop at the end of the trial period. Please consider upgrading to "Plus" plan'); ?></span>
                <?php endif ?>
             <?php else: ?>
                <span class="littleGrey"><?php echo __('API acess is only available for plan "Plus" or greater.');?></span>
             <?php endif ?>
            </div>
       </fieldset>
       <br/>
       <br/>
    <?php endforeach ?>
</div>
